{% for brick in bricks %}
volume {{ volname }}-client-{{ brick["brick_index"] }}
    type protocol/client
    option volfile-key /{{ volname }}
    option transport.socket.read-fail-log false
    option remote-subvolume {{ brick["brick_path"] }}
    option remote-host {{ brick["node"] }}
end-volume

{% endfor %}

{% for i in range(dht_subvol|length) %}
volume {{ volname }}-replica-{{ i }}
    type cluster/replicate
    option data-self-heal on
    option iam-self-heal-daemon true
    option metadata-self-heal on
    option self-heal-daemon on
    option choose-local true
    option ensure-durability on
    option data-change-log on
    option entry-self-heal on
    subvolumes {{ volname }}-client-{{ i * 3 }} {{ volname }}-client-{{ (i * 3) + 1}} {{ volname }}-client-{{ (i * 3) + 2}}
end-volume

{% endfor %}

volume {{ volname }}
    type debug/io-stats
    subvolumes {{ dht_subvol|join(' ') }}
end-volume
